from huggingface_hub import snapshot_download
import os
# from transformers import BertTokenizer, GPT2LMHeadModel ,TextGenerationPipeline
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"

# 下载整个仓库  i:/models/uer/gpt2-chinese-poem
snapshot_download(
    repo_id="uer/gpt2-chinese-poem",
    local_dir="i:/models",
    local_dir_use_symlinks=False,
    resume_download=True
)